package com.plian.system.controller.pf;

import com.plian.Tools.base.BaseController;
import com.plian.system.dto.pf.PerformanceReportDTO;
import com.plian.system.model.R;
import com.plian.system.service.pf.IPerformanceReportService;
import com.plian.system.vo.report.ReportReturnVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Take-off
 * @Description: TODO
 * @Date: 2023/1/9 3:10 PM
 * @Version: 1.0
 **/
@RestController
@AllArgsConstructor
@RequestMapping("api/performancereport")
@Api(value = "PerformanceReportController", tags = "考核分配报表 控制器")
public class PerformanceReportController extends BaseController {

    private final IPerformanceReportService performanceReportService;

    @PostMapping("/getPerformanceReport")
    @ApiOperation(value = "履职成效报表", notes = "传入 dto")
    public R<ReportReturnVO> getPerformanceReport(@RequestBody PerformanceReportDTO dto) {
        return R.data(performanceReportService.getPerformanceReport(dto));
    }

    @PostMapping("/getAllCountReport")
    @ApiOperation(value = "汇总得分报表", notes = "传入 dto")
    public R<ReportReturnVO> getAllCountReport(@RequestBody PerformanceReportDTO dto) {
        return R.data(performanceReportService.getAllCountReport(dto));
    }

    @PostMapping("/getBusinessMonthReport")
    @ApiOperation(value = "经营业绩报表", notes = "传入 dto")
    public R<ReportReturnVO> getBusinessMonthReport(@RequestBody PerformanceReportDTO dto) {
        return R.data(performanceReportService.getBusinessMonthReport(dto));
    }

    @PostMapping("/getOrgCountReport")
    @ApiOperation(value = "企业汇总得分表", notes = "传入 dto")
    public R<ReportReturnVO> getOrgCountReport(@RequestBody PerformanceReportDTO dto) {
        return R.data(performanceReportService.getOrgCountReport(dto));
    }
}
